package com.tw.marsrover;

public enum Direction{

    North("North"){
        @Override
        public Direction changeToLeft(){
            return West;
        }

        @Override
        public Direction changeToRight(){
            return East;
        }
    },

    South("South"){
        @Override
        public Direction changeToLeft(){
            return East;
        }

        @Override
        public Direction changeToRight(){
            return West;
        }
    },

    East("East"){
        @Override
        public Direction changeToLeft(){
            return North;
        }

        @Override
        public Direction changeToRight(){
            return South;
        }
    },

    West("West"){
        @Override
        public Direction changeToLeft(){
            return South;
        }

        @Override
        public Direction changeToRight(){
            return North;
        }
    };

    private String direction;

    private Direction(String direction) {
        this.direction = direction;
    }

    abstract public Direction changeToLeft();

    abstract public Direction changeToRight();

    public String getDirectionName(){
        return direction;
    }

}


